<template>
  <div>
    <van-sticky>
      <van-nav-bar title="注册页面" left-arrow @click-left='backOff' />
    </van-sticky>
    <van-row style='margin-top: 24vh'>
      <van-col span='24'>
        <van-form @submit="onSubmit">
          <van-field
            input-align="right"
            v-model="cno"
            name="cno"
            label="学号"
            placeholder="学号"
            clearable
          />
          <van-field
            input-align="right"
            v-model="password"
            type="password"
            name="password"
            label="密码"
            placeholder="密码"
          />
          <van-field
            input-align="right"
            v-model="password2"
            type="password"
            name="password2"
            label="确认密码"
            placeholder="确认密码"
          />
          <van-field
            input-align="right"
            v-model="email"
            name="email"
            label="邮箱"
            placeholder="邮箱"
          />
          <div style="margin: 16px;">
            <van-button round block type="info" native-type="submit">提交</van-button>
          </div>
        </van-form>
      </van-col>
    </van-row>
  </div>
</template>

<script>
export default {
  name: 'Register',
  data() {
    return {
      cno: '',
      password: '',
      password2: '',
      email: ''
    }
  },  
  methods: {
    backOff() {
      this.$router.go(-1)
    },
    onSubmit(values) {
      // console.log(values)
      this.$toast.fail('暂时不开放注册功能')
      // 检验无误后, 发送到后台, 在登录表和个人表中添加新数据
    }
  }
}
</script>

<style scoped>
/* @import url(); 引入css类 */
</style>
